#include "sk_typ0.h"
#include "sk_bitfieldsrcd.h"
/*
//char * empty_puzzle=".................................................................................";


//The cell indexes in each of the 9 rows, 9 columns, and 9 squares out of fss
byte cellsInGroup[27][9] =
{
	{ 0, 1, 2, 3, 4, 5, 6, 7, 8},{ 9,10,11,12,13,14,15,16,17},{18,19,20,21,22,23,24,25,26},
	{27,28,29,30,31,32,33,34,35},{36,37,38,39,40,41,42,43,44},{45,46,47,48,49,50,51,52,53},
	{54,55,56,57,58,59,60,61,62},{63,64,65,66,67,68,69,70,71},{72,73,74,75,76,77,78,79,80},
	{ 0, 9,18,27,36,45,54,63,72},{ 1,10,19,28,37,46,55,64,73},{ 2,11,20,29,38,47,56,65,74},
	{ 3,12,21,30,39,48,57,66,75},{ 4,13,22,31,40,49,58,67,76},{ 5,14,23,32,41,50,59,68,77},
	{ 6,15,24,33,42,51,60,69,78},{ 7,16,25,34,43,52,61,70,79},{ 8,17,26,35,44,53,62,71,80},
	{ 0, 1, 2, 9,10,11,18,19,20},{ 3, 4, 5,12,13,14,21,22,23},{ 6, 7, 8,15,16,17,24,25,26},
	{27,28,29,36,37,38,45,46,47},{30,31,32,39,40,41,48,49,50},{33,34,35,42,43,44,51,52,53},
	{54,55,56,63,64,65,72,73,74},{57,58,59,66,67,68,75,76,77},{60,61,62,69,70,71,78,79,80}
};




class GEN_TABLES_plus{
public:
	GEN_TABLES_plus(){ 
	//============== 
		Genbase(); 	Gen2();	Gen3(); Gen4();
	}
	void Genbase();
	void Gen2();
	void Gen3();
	void Gen4();

}gen_tables;

/*
// tables generated in the below constructor
int TblMult3[9];  // 3*i
int TblMult9[9];  // 9*i
int TblOtherMask9[9] ; // clear digit in three lines in the column of a block
int Tbldiv3[27]; //i/3 eg :  mini row or digit in F
byte Tblmod3[27];  // i%3
int TblMod9[81]; //i%9 eg : column in block or cell to column
int Tblstartblock[27]; // block offset to first cell
int Tblofftorow[27];// i/9 relative row within a block  (offset to row)
int Tblofftobox[27];//(i%9)/3offset to box
// other bands for a F[i]
byte TblAnother1[27];
byte TblAnother2[27];
int TblBoard_BlockMask27[27]; //1<<i 
int TblRowMask[8];// rows where single  found  000 to 111
word TblShrinkUnsolved[8]; // only unsolved rows
int TblMask26row[9];
void GEN_TABLES::Genbase(){
	for(int i=0;i<9;i++){
		TblMult3[i] = 3*i;
		TblMult9[i] = 9*i ;
		TblOtherMask9[i]=((1<<i) * Zhoucol) ^ BIT_SET_30;
	}
	for(int i=0;i<27;i++){
		Tbldiv3[i] = i/3;
		Tblmod3[i] = i%3;
		TblMod9[i] = TblMod9[i+27] = TblMod9[i+54] = i%9;
		Tblstartblock[i] = (i%3)*27;
		Tblofftorow[i] = i/9;
		Tblofftobox[i] = (i%9)/3;
		TblAnother1[i]=(i%3)? 3*( i/3 ) :3*( i/3 )+1;
		TblAnother2[i]=(i%3 - 2)?3*( i/3 )+2 :3*( i/3 )+1;
		TblBoard_BlockMask27[i] = (1<<i);
	}
	for(int i=0;i<8;i++){ // bits 25_27  0 to 7
		int rmask=0;  // rows where a single is found
		if(i&1) rmask |= 0x1FF;
		if(i&2) rmask |= (0x1FF<<9);
		if(i&4) rmask |= (0x1FF<<18);
		TblRowMask[i]=rmask ^  BIT_SET_27;

		int rshr=0; // in pointing claiming killl shrinked defined
		if(i&1) rshr |= 7;
		if(i&2) rshr |= (7<<3);
		if(i&4) rshr |= (7<<6);
		TblShrinkUnsolved[i] = rshr;
	}


	for(int i=0;i<9;i++){ // i is the minirow order 0_8
		int w=0x1ff ^ (7<<3*(i%3)); //to kill in the row
		TblMask26row[i]=  (w<<(9*(i/3))) ^ BIT_SET_30;

	}

}

byte Tbloffset[81]; // giving cell to offset in a band
byte TblBoard_Block[81]; // giving cell -> band 

byte TblCelltoBox[81];// relative position in the box
//byte TblaffectedCells[81][20]; // all cells controlled by cell i
byte TblOtherSameBand[27][8]; // cleaning cells other digits

byte BitCount[512] ; // number of bits in a 9 bits value
byte TblBitToInd[512] ; // value 1 to 9 for 1<<n 
byte TblBitIndex[257] ; // value 0 to 8 for 1<<n 
byte Tblfirst0_8[512]; // lowest bit set to 1  bits 1_9
byte TblShrinkMask[512] ;// existing minirows 000 to 111

void GEN_TABLES::Gen2(){
	for(int i=0;i<81;i++){
		Tbloffset[i]=i%27;
		TblBoard_Block[i] =i/27;
		TblCelltoBox[i]=3*((i%27)/9) +i%3 ;
	}

	byte *p=TblOtherSameBand[0];
	for(int i=0;i<27;i++){
		int digit=i/3,blk=i%3;
		for(int j=0;j<9;j++)if(j-digit) (*p++) = (3*j+blk) ;
	}

	for(int i=0;i<512;i++){
		int n=0,po=0;
		for(int j=8;j>=0;j--) if(i &(1<<j)){
			n++; po=j;
		}
		int bti= (n==1)? po+1:0;
		TblBitToInd[i]= bti;
		Tblfirst0_8[i] = po;
		BitCount[i] = n;
		int sh=0;
		if(i& 7) sh+=1;
		if(i&(7<<3)) sh+=2;
		if(i&(7<<6)) sh+=4;
		TblShrinkMask[i] = sh;
	}
	for(int i=0;i<256;i++) TblBitIndex[i]=0;
	for(int i=1;i<9;i++) TblBitIndex[1<<i]=i;
}

int TblComplexMask[512]; // keep mini rows still valid optimised process
int TblKillMask[512]; // killed candidates pointing general
word TblComplexShort[512];  // same as complex  minirows still valid
word TblComplexShortBox[512];
//int TblUniqFlag[8] = {1,1,1,0,1,0,0,0};
word TblNewBoxRow[512]; // new minirow alone in box after shrink
byte TblRowUniq[512] ; // 1 is row not defined in block  mode  to 111
word TblColumnSingleinBox[512];
word TblColumnSingle[512]; // single in column applied to shrinked bloc
word TblShrinkSingle[512] ; // keep only rows with single
int TblMaskSingle[512]; // kill in other blocks locked column /box
int TblMaskDouble[512];// kill for locked in box / column

void GEN_TABLES::Gen3(){
	for(int i=0;i<512;i++){
		// pointing claiming in band kill9 initial = already killed
		int shsh=0,kill=0,aigkill=0,ctlrb=0,kill9= i ^  0x1ff,killd=kill9;
		for(int ib=0;ib<3;ib++){ // first locked in boxes
			int iw=i & (0x49<<ib); // shrinked box 1  1..1..1
			if(!BitCount[iw]) {aigkill=1;break;}
			if(BitCount[iw] == 1){
				int imini=Tblfirst0_8[iw],ir=imini/3;
				shsh |= (1<<imini);
				for(int ib2=0;ib2<3;ib2++){ // kill the row
					if(ib==ib2)continue;
					kill |= (7<<(3*ib2))<<(9*ir);
					kill9 |= (1<<ib2)<<(3*ir);
				}
			}
		}
		if(aigkill) TblComplexShortBox[i]=0;
		else TblComplexShortBox[i]=kill9 ^ killd;

		word wnewbr=0,wnewbrw=TblComplexShortBox[i];
		if(wnewbrw) {// see if a new minirow alone appears
			for(int j=0;j<3;j++){
				word boxkill=(7<<(3*j)) & wnewbrw;
				if(!boxkill) continue;
				word newbox= (i &  (7<<(3*j))) ^ boxkill;
				if(BitCount[newbox]==1) wnewbr |= newbox;
			}
		}
		TblNewBoxRow[i]= wnewbr;

		// mask for any killed group of minirows
		int km=0;
		for(int j=0;j<9;j++)
			if((i & (1<<j))) 		km |=( 7 << (3*j));
		TblKillMask[i]=km^BIT_SET_30;

		for(int ir=0;ir<3;ir++){ // now locked in rows 
			int iw=i & (7<<(3*ir));
			if(!BitCount[iw]) {aigkill=1;break;}
			if(BitCount[iw] == 1){
				int imini=Tblfirst0_8[iw],ib=imini%3;
				if(ctlrb & (1<<ib)) {aigkill=1;break;}
				else ctlrb |= (1<<ib);
				shsh |= (1<<imini);
				for(int ir2=0;ir2<3;ir2++){ // kill the box
					if(ir2==ir) continue;
					kill |= (7<<(3*ib))<<(9*ir2);
					kill9 |= (1<<ib)<<(3*ir2);
				}
			}
		}
		if(aigkill) { kill=0; shsh=0;}
		else kill ^=BIT_SET_30;
		//small differences with zhou table, no logic difference
		TblComplexMask[i] = kill; 
		//  find shrinksingles

		int shsing;
		if(!kill || kill==BIT_SET_30){ // shrink must be 0
			shsing=0;
		}
		else{
			shsing= kill9 ^ 0x1ff;
			if(BitCount[shsing & 7 ] - 1) shsing &= 0x1f8;
			if(BitCount[shsing & 0x38 ] - 1) shsing &= 0x1c7;
			if(BitCount[shsing & 0x1c0 ] - 1) shsing &= 0x3f;
		}
		TblShrinkSingle[i] = shsing ;

		if(aigkill) TblComplexShort[i]=0;
		else TblComplexShort[i]=kill9 ^ killd;

		
		int wcols=0;  // TblColumnSingle 
		if(BitCount[i&7] && BitCount[i&0x38] && BitCount[i&0x1c0]){
			if(BitCount[i&7] == 1) wcols |= 0x49;
			if(BitCount[i&0x38] == 1) wcols |= 0x92;
			if(BitCount[i&0x1c0] == 1) wcols |= 0x124;
		}
		TblColumnSingle[i] = wcols;

		int wru=0;  // byte TblRowUniq[512]
		if(!(i&7) ) wru |= 1;
		if(!(i&0x38)) wru |= 2;
		if(!(i&0x1c0)) wru |=4;
		TblRowUniq[i] = wru;

		int killcols=0;
		if(BitCount[i&7] == 1) killcols |= i&7;		
		if(BitCount[i&0x38] == 1) killcols |= i&0x38;  
		if(BitCount[i&0x1c0] == 1) killcols |= i&0x1c0; 
		TblColumnSingleinBox[i]=killcols;

		int killcolsf= ( killcols | (killcols<<9) | (killcols<<18))^BIT_SET_30;
		TblMaskSingle[i] = killcolsf;

		int killcols2=0;
		if(BitCount[i&7] == 2) killcols2 |= i&7;		
		if(BitCount[i&0x38] == 2) killcols2 |= i&0x38;  
		if(BitCount[i&0x1c0] == 2) killcols2 |= i&0x1c0; 
		int killcolsf2= ( killcols2 | (killcols2<<9) | (killcols2<<18))^BIT_SET_30;
		TblMaskDouble[i] = killcolsf2;
	//	if(i==1)
	//		cout<<"ctl  i="<<dec<< i << "  " <<hex<<i
	//		<<  " killcolsf " <<killcolsf<<" TblMaskSingle "<< TblMaskSingle[i] <<endl;
	}}


byte tv_string[1024];
word tv_strindex[256];
void GEN_TABLES::Gen4(){
	tv_strindex[0]=0;
	int n=0;
	for(int i=1;i<256;i++){
		for(int j=0;j<9;j++)
			if(i & (1<<j))	tv_string[n++]=j;
		tv_strindex[i]=n;
	}

}



char * t16[401]={
	"6789123789123456","6789123789123465","6789123789123564","6789123789132465",
	"6789123789132546","6789123789132564","6789123789231564","6789123789231645",
	"6789123798132465","6789123798132546","6789123798132564","6789123798213564",
	"6789123798213654","6789123798231564","6789123798231645","6789123897231564",
	"6789123897231645","6789132789123546","6789132789132546","6789132789132564",
	"6789132789213456","6789132789213645","6789132789213654","6789132789231546",
	"6789132789231564","6789132879231564","6789231789123645","6789231789132546",
	"6789231789231564","6789231789312456","6789231798213645","7189236689237145",
	"7189236689237154","7189236689237415","7189236689237451","7189236689237514",
	"7189236689237541","7189236689273145","7189236689273154","7189236689273415",
	"7189236689273451","7189236689273514","7189236689273541","7189236689327145",
	"7189236689327154","7189236689327415","7189236689327451","7189236689327514",
	"7189236689327541","7189236689372145","7189236689372154","7189236689372415",
	"7189236689372451","7189236689372514","7189236689372541","7189236689723145",
	"7189236689723154","7189236689723415","7189236689723514","7189236689723541",
	"7189236689732145","7189236689732154","7189236689732415","7189236689732514",
	"7189236689732541","7189236698237145","7189236698237154","7189236698237415",
	"7189236698237514","7189236698237541","7189236698273145","7189236698273154",
	"7189236698273415","7189236698273514","7189236698273541","7189236698327145",
	"7189236698327154","7189236698327415","7189236698327541","7189236698372145",
	"7189236698372154","7189236698372415","7189236698372514","7189236698372541",
	"7189236698723145","7189236698723154","7189236698723415","7189236698723514",
	"7189236698732145","7189236698732154","7189236698732415","7189236698732514",
	"7189236869237145","7189236869237514","7189236869273145","7189236869273154",
	"7189236869273415","7189236869273514","7189236869327154","7189236869327415",
	"7189236869327514","7189236869372145","7189236869372154","7189236869372415",
	"7189236869372514","7189236869723145","7189236869723154","7189236869723514",
	"7189236869732145","7189236869732154","7189236896237145","7189236896237154",
	"7189236896237514","7189236896273145","7189236896273154","7189236896273514",
	"7189236896327145","7189236896327154","7189236896327514","7189236896372145",
	"7189236896372154","7189236896372514","7189236896723154","7189236896723514",
	"7189236896732154","7189236896732514","7189236968237154","7189236968237514",
	"7189236968273514","7189236968327154","7189236968327514","7189236968372154",
	"7189236968372514","7189236968723154","7189236968732154","7189236986237154",
	"7189236986273154","7189236986327154","7189236986372154","7189263689237145",
	"7189263689237415","7189263689237451","7189263689237514","7189263689273154",
	"7189263689273415","7189263689273451","7189263689273514","7189263689273541",
	"7189263689327154","7189263689327415","7189263689327514","7189263689327541",
	"7189263689372145","7189263689372154","7189263689372415","7189263689372451",
	"7189263689372514","7189263689723145","7189263689723154","7189263689723451",
	"7189263689732145","7189263689732154","7189263689732415","7189263689732451",
	"7189263689732514","7189263689732541","7189263698237154","7189263698237415",
	"7189263698237451","7189263698237514","7189263698273145","7189263698273415",
	"7189263698273451","7189263698273514","7189263698327145","7189263698327154",
	"7189263698327415","7189263698327451","7189263698327514","7189263698372154",
	"7189263698372415","7189263698372514","7189263698372541","7189263698732145",
	"7189263698732154","7189263698732451","7189263869237154","7189263869237415",
	"7189263869237514","7189263869273451","7189263869327415","7189263869327451",
	"7189263869327514","7189263869372145","7189263869372154","7189263869372514",
	"7189263896237145","7189263896237154","7189263896237451","7189263896327145",
	"7189263896327154","7189263896327415","7189263896327451","7189263896327514",
	"7189263896327541","7189263896372145","7189263896372154","7189263896372451",
	"7189263968327145","7189263968327154","7189263968327415","7189263968327514",
	"7189263968327541","7189263968372145","7189263986327145","7189263986327154",
	"7189263986327451","7189326689237451","7189326689237514","7189326689237541",
	"7189326689273145","7189326689273451","7189326689273541","7189326689327154",
	"7189326689327451","7189326689327541","7189326689372415","7189326689372541",
	"7189326689723145","7189326689723415","7189326689732145","7189326689732415",
	"7189326689732514","7189326689732541","7189326698237145","7189326698237541",
	"7189326698273514","7189326698273541","7189326698732415","7189326869372514",
	"7189623689237145","7189623689237154","7189623689273145","7189623689273154",
	"7189623689273541","7189623689327145","7189623689327154","7189623689372145",
	"7189623689372154","7189623689372514","7189623689723145","7189623689723154",
	"7189623689723415","7189623689723451","7189623689723514","7189623689723541",
	"7189623689732145","7189623689732154","7189623689732415","7189623689732451",
	"7189623689732514","7189623689732541","7189623698237145","7189623698237154",
	"7189623698237541","7189623698273145","7189623698273154","7189623698327145",
	"7189623698327154","7189623698327514","7189623698372145","7189623698372154",
	"7189623698732145","7189623698732154","7189623698732415","7189623698732514",
	"7189623698732541","7189623869237145","7189623869273145","7189623869273154",
	"7189623869273451","7189623869327154","7189623869372145","7189623869372154",
	"7189623896237145","7189623896237154","7189623896237415","7189623896237451",
	"7189623896237514","7189623896237541","7189623896327145","7189623896327154",
	"7189623896327415","7189623896327451","7189623896327514","7189623896372145",
	"7189623896372154","7189623896372451","7189623968327145","7189623968327154",
	"7189623968327415","7189623968372145","7189623968372154","7189623986327145",
	"7189623986327154","7189623986327415","7189623986327451","7189623986327514",
	"7189623986327541","7189632689237145","7189632689273145","7189632689273154",
	"7189632689273514","7189632689327154","7189632689372145","7189632689372154",
	"7189632689723145","7189632689723514","7189632689732145","7189632689732154",
	"7189632689732514","7189632689732541","7189632698237145","7189632698237154",
	"7189632698237514","7189632698273145","7189632698327145","7189632698327154",
	"7189632698327541","7189632698372154","7189632698732145","7189632698732514",
	"7189632869273145","7189632869372145","7189632896237145","7189632896237415",
	"7189632896327145","7189632896327154","7189632896327451","7189632896327541",
	"7189632896372145","7189632896372154","7189632896372451","7189632968327145",
	"7189632968327154","7189632968327451","7189632986327145","7289163689173452",
	"7289163689713254","7289163698137425","7289163698137524","7289163698317254",
	"7289163698317524","7289163698713254","7289163869713245","7289163869731245",
	"7289163869731524","7289163896317245","7289163896731524","7289613689173245",
	"7289613689713245","7289613689713254","7289613698137254","7289613698317245",
	"7289613698317254","7289613698713245","7289613869713245","7289613869731245",
	"7289613869731254","7289613896137245","7289613896137254","7289613896317245",
	"7289613896317425","7289613896731245","7289613896731254","7289613968137245",
	"7289613968137254","7289613968731245","7289613986137245","7289631689173245",
	"7289631689713254","7289631698317254","7289631869713245","7289631869713254",
	"7289631869731245","7289631869731254","7289631896137245","7289631896137254",
	"7289631896137425","7289631896317245","7289631896317254","7289631896731245",
	"7289631968137254","7289631968731245","7289631986137245","7389612896127354",
	"7389612896172354","7389612896271354","7389612896721354","7389621896217354",
	"7893612986217354" 
};

char * t44gang[44]={
"123456789456789123789123456","123456789456789123789123465","123456789456789123789123564","123456789456789123789132465",
"123456789456789123789132546","123456789456789123789132564","123456789456789123789231564","123456789456789123789231645",
"123456789456789123798132546","123456789456789123798213564","123456789456789123798213654","123456789456789123798231564",
"123456789456789123798231645","123456789456789123897231564","123456789456789132789123546","123456789456789132789213456",
"123456789456789132789213645","123456789456789132789213654","123456789456789132789231546","123456789456789231789123645",
"123456789456789231789312456","123456789457189236689273145","123456789457189236689273154","123456789457189236689273514",
"123456789457189236689372145","123456789457189236689372154","123456789457189236698237514","123456789457189236698723145",
"123456789457189236698732145","123456789457189236869372145","123456789457189263689273154","123456789457189263689723154",
"123456789457189263689732154","123456789457189263968327145","123456789457189263968327514","123456789457189263968372145",
"123456789457189263986327145","123456789457189263986327154","123456789457189623689723145","123456789457189623689723154",
"123456789457189623689723514","123456789457189632698732514","123456789457189632896372154","123456789457289631896137254",
};





char *gtypes[44] = {
   "123456789123456789123456789",
   "123456789123456789123457689",
   "123456789123456789124357689",
   "123456789123456789124378569",
   "123456789123456789147258369",
   "123456789123457689123458679",
   "123456789123457689123468579",
   "123456789123457689124356789",
   "123456789123457689124358679",
   "123456789123457689124367589",
   "123456789123457689124368579",
   "123456789123457689124389567",
   "123456789123457689126345789",
   "123456789123457689126347589",
   "123456789123457689126348579",
   "123456789123457689145267389",
   "123456789123457689145268379",
   "123456789123457689146258379",
   "123456789123457689148259367",
   "123456789124357689125348679",
   "123456789124357689125367489",
   "123456789124357689125368479",
   "123456789124357689125378469",
   "123456789124357689126358479",
   "123456789124357689126378459",
   "123456789124357689126389457",
   "123456789124357689128345679",
   "123456789124357689128356479",
   "123456789124357689128359467",
   "123456789124357689134258679",
   "123456789124357689134268579",
   "123456789124357689135268479",
   "123456789124357689135278469",
   "123456789124357689136258479",
   "123456789124357689136278459",
   "123456789124357689137268459",
   "123456789124357689138259467",
   "123456789124357689138269457",
   "123456789124357689158267349",
   "123456789124378569129356478",
   "123456789124378569135279468",
   "123456789124378569137245689",
   "123456789124378569157268349",
   "123456789147258369159267348",
};

char *ggrids[44] = {
   "147258369258369147369147258471582693683491725592673481714925836936814572825736914",
   "147268359258349176369157248481592763673481925592673481814925637736814592925736814",
   "147368259269157438358249176471582963685493712923716845734925681812634597596871324",
   "147359286258167439369248175481932657673485912925716348794523861812674593536891724",
   "148269753259347186367158429471692835592483617683715942724836591916524378835971264",
   "147256389258379146369148257471562893693481725582793461714625938835914672926837514",
   "147256389258349167369178245471562893593481726682793451714625938835914672926837514",
   "147358269259176438368249157431682975875493612926715843694527381512834796783961524",
   "147356289258179436369248157471832965683495712925617348894523671512764893736981524",
   "147358269259176438368249175481762953695483712723915846934527681812634597576891324",
   "147356289268179435359248167471832956683495712925617348894523671512764893736981524",
   "147358296268179435359246187481792653675483912923615748834927561512864379796531824",
   "147258639259376148368149257471562893693481725582793461914825376735614982826937514",
   "147258639259346178368179245481962753573481926692537481814623597935714862726895314",
   "147258639259346187368179245471562893593481726682793451714925368835614972926837514",
   "148279563259346178367158429471682935982435617536917842624593781715824396893761254",
   "148279563257346189369158427471692835536487912982513746724835691615924378893761254",
   "147259683269348157358176429481762935592483716673915248824597361715634892936821574",
   "147256893268349157359178426431982675572463918896715342624897531715634289983521764",
   "147236589258479136369158247471923865625841973983765412534612798796584321812397654",
   "147238569259476138368159274471623985685941327932785416714562893896314752523897641",
   "147236589268459137359178264481623975675941328932785416714562893896314752523897641",
   "147236589258479136369158274471923865685741923932685417514362798793814652826597341",
   "147238659268459137359176284481623975675941328932785416714562893593814762826397541",
   "147239685258476139369158274471823956695741328832965417714592863583614792926387541",
   "147238695268459137359176284481923576675841329932765418714592863893614752526387941",
   "147236859258479136369158247471923685625841793983765412534612978796384521812597364",
   "147236859268459137359178264481623795675941328932785416714562983593814672826397541",
   "147239856269458137358176294481923765675841329932765418714592683893614572526387941",
   "147256389268139457359478126481723695695841732723965841814692573572314968936587214",
   "147256389258139467369478125481723956695841732723965841814692573572314698936587214",
   "147236589258179364369458127481923756572641938693785412714562893936814275825397641",
   "147236589268159374359478126481623957572941638693785412714362895925814763836597241",
   "147238659259176384368459127481923576625741938793685412514862793972314865836597241",
   "147239685269158374358476129481923567625741938793685412814562793972314856536897241",
   "147256389258139764369478125481923576625741938793685412514362897972814653836597241",
   "147239856258176394369458127471923568582641739693785412714362985925814673836597241",
   "147236895258179364369458127481623579675941238923785416714562983896314752532897641",
   "147238569268459173359176824471923685685741392932865417814592736723614958596387241",
   "147235968259486137368179254471523689695841723832967415514392876783614592926758341",
   "147236598269185374358479126471823965625941837893567412714352689982614753536798241",
   "147286359258139746369475128471923685625841973983567412534612897896754231712398564",
   "147236589258479163369185724471523698695841237832967415514392876783614952926758341",
   "148729563269453178357186924471832659592641387836975412714368295985214736623597841",
};
byte	tperm6[6][3]=	{  
	{ 0, 1, 2 },{ 0, 2, 1 },{ 1, 0, 2 },
	{ 1, 2, 0 },{ 2, 0, 1 },{ 2, 1, 0 }	};

	*/